package com.abvnet.project.water.api.web;

import com.abvnet.framework.web.controller.BaseController;
import com.abvnet.framework.web.domain.AjaxResult;
import com.abvnet.project.water.project.domain.ProjectComment;
import com.abvnet.project.water.project.service.IProjectCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/project/comment")
public class ApiProjectCommentController extends BaseController {

    @Autowired
    private IProjectCommentService projectCommentService;

    @GetMapping("/list")
    public AjaxResult list(ProjectComment projectComment) {
        return AjaxResult.success(projectCommentService.selectProjectCommentListForApi(projectComment));
    }

    @PostMapping("/edit")
    public AjaxResult editSave(ProjectComment projectComment) {
        return AjaxResult.success(projectCommentService.updateProjectComment(projectComment));
    }
}
